<template>
    <div>
        <el-table
            :data="orderDetail"
            border
            style="width: 100%">
            <el-table-column
            fixed
            prop="id"
            label="序号"
            width="150">
            </el-table-column>
            <el-table-column
            prop="order_no"
            label="订单编号"
            width="auto">
            </el-table-column>
            <el-table-column
            prop="promoter_type"
            label="创客类型"
            :formatter="changeType"
            width="auto">
            </el-table-column>
            <el-table-column
            prop="amount"
            label="实付金额"
            width="auto">
            </el-table-column>
            <el-table-column
            prop="proportion"
            label="佣金比率"
            width="auto">
            </el-table-column>
            <el-table-column
            prop="commission"
            label="结算金额"
            width="auto">
            </el-table-column>
            <el-table-column
            prop="create_time"
            label="下单时间"
            :formatter="changeTime"
            width="auto">
            </el-table-column>
        </el-table>
    </div>
</template>
<script>
export default {
    props:{
        orderNo:{
            type:String,
            default:''
        },
        shopType:{
            type:String,
            default:''
        }
    },
    data(){
        return{
            orderDetail:[],
            page:1,
            pagesize:10,
            // order_no:''
        }
    },
    watch:{
        orderNo(val){
            console.log(val,'订单号--');
            // this.order_no = val
        },
        shopType(val){
            console.log(val);
            if(val=='1'){

            }
        }
    },
    methods: {
        // 获取创客结算明细
        getMakerOrderDetail(){
            let params = {
                order_no:this.orderNo,
                page:this.page,
                pagesize:this.pagesize,
                type:this.shopType
            }
            this.$http.post('/api/root/settle/promoterOrderDetail',params).then(res=>{
                console.log(res,'创客结算明细');
                if(res.code==1){
                    this.orderDetail = res.data.list?res.data.list:[]
                }
            })
        },
        // 创客类型
        changeType(row, column, cellValue, index){
            if(cellValue == 0){
                return '创业精英'
            }else if(cellValue == 1){
                return '创业主'
            }else{
                return ''
            }
        },
        // 下单时间
        changeTime(row, column, cellValue, index){
            return this.$moment(cellValue*1000).format('yyyy-MM-DD')
        }
    },
}
</script>
<style lang="less">

</style>


